package cn.com.open.itembank.dto;


import java.util.ArrayList;
import java.util.List;

/**
 * 策略大题.
 */
public class RuleSection {
    /**
     * Instantiates a new Rule section.
     */
    public RuleSection() {
        this.instructionDuration = 0;
        this.mandatoryQuestions = new ArrayList<>();
        this.exampleQuestions = new ArrayList<>();
        this.ruleItemGroups = new ArrayList<>();
    }

    /**
     * 答题说明时长.
     */
    private Integer instructionDuration;

    /**
     * 必考题.
     */
    private List<String> mandatoryQuestions;

    /**
     * 例题.
     */
    private List<String> exampleQuestions;

    /**
     * 策略题组.
     */
    private List<RuleItemGroup> ruleItemGroups;

    /**
     * Gets instruction duration.
     *
     * @return the instruction duration
     */
    public Integer getInstructionDuration() {
        return instructionDuration;
    }

    /**
     * Sets instruction duration.
     *
     * @param instructionDuration the instruction duration
     */
    public void setInstructionDuration(Integer instructionDuration) {
        this.instructionDuration = instructionDuration;
    }

    /**
     * Gets mandatory questions.
     *
     * @return the mandatory questions
     */
    public List<String> getMandatoryQuestions() {
        if (mandatoryQuestions == null) {
            mandatoryQuestions = new ArrayList<>();
        }
        return mandatoryQuestions;
    }

    /**
     * Gets example questions.
     *
     * @return the example questions
     */
    public List<String> getExampleQuestions() {
        if (exampleQuestions == null) {
            exampleQuestions = new ArrayList<>();
        }
        return exampleQuestions;
    }

    /**
     * Gets rule item groups.
     *
     * @return the rule item groups
     */
    public List<RuleItemGroup> getRuleItemGroups() {
        if (ruleItemGroups == null) {
            ruleItemGroups = new ArrayList<>();
        }
        return ruleItemGroups;
    }

    /**
     * copy rule section.
     *
     * @return the rule section
     */
    public RuleSection copy() {
        RuleSection copy = new RuleSection();
        copy.instructionDuration = instructionDuration;

        for (String q : mandatoryQuestions) {
            copy.mandatoryQuestions.add(q);
        }

        for (String q : exampleQuestions) {
            copy.exampleQuestions.add(q);
        }

        for (RuleItemGroup r : ruleItemGroups) {
            copy.ruleItemGroups.add(r.copy());
        }

        return copy;
    }
}
